﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private readonly Dictionary<string, string> _user = new Dictionary<string, string>


        private void Form1_Load(object sender, EventArgs e)
        {
            this.BackColor = Color.Blue;

            //MessageBox.Show("苍天绕过谁");

            HelpButton = true;

            MinimizeBox = false;
            MaximizeBox = false;
        }

        private void Form1_MouseClick(object sender, MouseEventArgs e)
        {
            List<Color> list = new List<Color>();


            list.Add(Color.White);

            list.Add(Color.Black);
            list.AddRange(new Color[] 
            {
                Color.Blue,Color.Red,Color.Yellow,Color.Orange,
            });

            Random random = new Random();
            var rndInt = random.Next(0, 8);

            var rndColor = list[rndInt];


            BackColor = rndColor;
        }

        private void Form1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            MessageBox.Show("你瞅啥！");


        }

        private void Form1_BackColorChanged(object sender, EventArgs e)
        {
            MessageBox.Show("在瞅一下试试！","欠扁？");
        }
        private void Form1_MouseDown(object sender, MouseEventArgs e)
        {
            MessageBox.Show("当鼠标按下时发生一件事！");


        }

        private void Form1_MouseUp(object sender, MouseEventArgs e)
        {
            MessageBox.Show("鼠标弹起时又发生一件事！");

        }
       private void button1_Click(object sender, EventArgs e)
       {
            var uName = "huan";
            var pWord = "123";


            var uid = userName.Text;
            var pwd = passWord.Text;

            if (uName==uid && pWord==pwd )
            {

                MessageBox.Show("登陆成功","恭喜你！",MessageBoxButtons.YesNo,MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("登陆失败","很遗憾！",MessageBoxButtons.YesNo,MessageBoxIcon.Warning);
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {

        }

       
    }
}
